
// 此处置放常量

import type { LowcodeField } from "./interface";

export const LOWCODEUNIQUEKEY = "mainlowcodedesign";

export const LOWCODERUNTIMEUNIQUEKEY = "mainlowcodepcruntime";

export const LOWCODERUNTIMEMOBILEUNIQUEKEY = "mainlowcodemobileruntime"

export const lowcodeTenantField = "c_tenant_id";

export const LOWCODEDETAILSTATUSCONF = {
  "尚未审核": "primary_detail",
  "正在审批": "warning_detail",
  "已审核": "success_detail",
  "审批未通过": "error_detail",
  "已作废": "invalid_detail",
}

export const lowcodeNumberToRuntimePrecision = {
  '#,##0.000000': 6,
  '#,##0.00000': 5,
  '#,##0.0000': 4,
  '#,##0.000': 3,
  '#,##0.00': 2,
  '#,##0.0': 1,
  '#,##0.00%': 2,
  '#,##0': 0
}

export const lowcodeDebounceTime = 500;

export const cardInputComponentMap: { [key: string]: string } = {
  "text": "text",
  "textarea": "textarea",
  "imageupload": "image",
  "radiogroup": "radio",
  "checkbox": "multi",
  "checkboxgroup": "multi",
  "numberinput": "number",
  "time": "date",
  "datetime": "date",
  "switch": "switch",
  "select": "selector",
  /**
 * "multitext", "dialoginput", "buttongroup", "daterange", "richtext", "textblock", "fileupload", "status"
 * 
 * text textarea imageupload  radiogroup  checkbox checkboxgroup
 * text textarea image        radio        multi                  
 * 
 * numberinput                                time datetime   switch  select
 * number number2 textname textname2 password date            switch  selector scan
 */
}

/**
 * @description 单据状态
 * */
export enum EBillStatus {
  尚未审核 = "0",
  NotApproved = "0",
  预审核 = "2",
  PreAudit = "2",
  已审核 = "3",
  Reviewed = "3",
  已生效 = "5",
  Effective = "5",
  已结束 = "6",
  HasEnded = "6",
  已终止 = "7",
  Terminated = "7",
  已取消 = "7",
  Cancelled = "7",
  已作废 = "9",
  Voided = "9",
}

/**
 * @description 单据审批状态
 * */
export enum EBillApproveStatus {
  尚未审批 = "1",
  NotYetApproved = "1",
  正在审批 = "2",
  ApprovalProgress = "2",
  审批已通过 = "3",
  ApprovalPassed = "3",
  审批未通过 = "4",
  ApprovalFailed = "4"
}

/**
 * @description 单据状态 (中文)
 * */
export enum ECBillStatus {
  NotApproved = "尚未审核",
  PreAudit = "预审核",
  Reviewed = "已审核",
  Effective = "已生效",
  HasEnded = "已结束",
  Terminated = "已终止",
  Cancelled = "已取消",
  Voided = "已作废",
}

/**
 * @description 单据审批状态 (中文)
 * */
export enum ECBillApproveStatus {
  NotYetApproved = "尚未审批",
  ApprovalProgress = "正在审批",
  ApprovalPassed = "审批已通过",
  ApprovalFailed = "审批未通过"
}

export const EBillStatusTxt = {
  "0": "尚未审核",
  "2": "预审核",
  "3": "已审核",
  "5": "已生效",
  "6": "已结束",
  "7": "已取消",
  "9": "已作废",
  "尚未审核": "尚未审核",
  "预审核": "预审核",
  "已审核": "已审核",
  "已生效": "已生效",
  "已结束": "已结束",
  "已终止": "已终止",
  "已取消": "已取消",
  "已作废": "已作废",
}

export const lowcodeDefaultField: LowcodeField = {
  idField: "c_id",
  modifyUserField: "c_modify_userno",
  modifyDtField: "c_modify_dt",
  statusField: "c_status",
  approveStatusField: "c_approve_status",
  mkUserField: "c_mk_userno",
  mkDtField: "c_mk_dt",
  auUserField: "c_au_userno",
  auDtField: "c_au_dt"
};

export const lowcodeRowKey = "__key";

export const lowcodePrimaryLink = "===";
